package cn.fenqing.gof.observer;

import lombok.Data;

/**
 * @author fenqing
 */
public class App {

    public static void main(String[] args) {
        User user = new User();
        Observer<User> observer = new EmailObserver<>(user);
        Observer<User> observer1 = new ToStringObserver<>(user);
        user.binding(observer);
        user.binding(observer1);

        user.setUsername("123");
        user.setPassword("123");


        user.setUsername("123");
        user.setPassword("123");


        user.setUsername("123");
        user.setPassword("123");



        user.setUsername("123");
        user.setPassword("123");



    }

}
